#业务需求1.0
import random
num = random.randint(1, 100)
while (1):
    num1 = input("猜数字游戏，请输入1-100的数值（整数包括边界）:")
    num2 = int(num1)
    if num2 < 1 or num2 > 100:
        print("请输入指定范围的整数")
    elif num2 > num:
        print("大了")
    elif num2 < num:
        print("小了")
    else:
        print("恭喜猜中，本轮幸运数字：", num)
        break;
#业务需求2.0
import random
money = 5000
num = random.randint(1, 100)
while (1):
    if money <= 0:
        print("余额不足，当前余额为:", money)
        break;
    num1 = input("猜数字游戏，请输入1-100的数值（整数包括边界）:")
    num2 = int(num1)
    if num2 < 1 or num2 > 100:
        print("请输入指定范围的整数")
    elif num2 > num:
        money -= 500
        print("大了,剩余余额为", money)
    elif num2 < num:
        money -= 500
        print("小了,剩余余额为", money)
    else:
        money += 3000
        print("恭喜猜中，本轮幸运数字：", num, "剩余余额为", money)
        break;
#业务需求3.0
import random
money = 5000
run = True
while (run):
    num = random.randint(1, 100)
    while (1):
        if money <= 0:
            print("余额不足，当前余额为:", money)
            break;
        num1 = input("猜数字游戏，请输入1-100的数值（整数包括边界）:")
        num2 = int(num1)
        if num2 < 1 or num2 > 100:
            print("请输入指定范围的整数")
        elif num2 > num:
            money -= 500
            print("大了,剩余余额为", money)
        elif num2 < num:
            money -= 500
            print("小了,剩余余额为", money)
        else:
            money += 3000
            print("恭喜猜中，本轮幸运数字：", num, "剩余余额为", money)
            break;
    start = input("是否继续，继续请输入继续反之随意输入退出") == "继续"
    run = start